<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SuperGlobalVariable6</title>
</head>
<body>
    <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
        Name: <input type="text" name="fname">
        <input type="submit">
    </form>

    <?php
    $name = $_REQUEST['fname'];
    echo $name
    ?>

    <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
        Name: <input type="text" name="fname">
        <input type="submit">
    </form>

    <?php
        $name = $_POST['fname'];
        echo $name;
    ?>

    <a href="test_get.php?subject=PHP&web=php.cn">Test $GET</a>

   <!--  以下实例显示了 "test_get.php" 文件的代码: -->
    <?php
        echo "Study " . $_GET['subject'] . " at " . $_GET['web'];
    ?>
</body>
</html>